<?php
include '../common.func.php';
$tags = getTags();
foreach ($tags as $tagName => $tag) {
    $posts = array();
    $postIndex = $tag['posts'];
    foreach ($postIndex as $post) {
        $p = getPostById($post);
        if ($p) {
            array_push($posts, $p);
        }
    }

    $config = array();
    $config['posts'] = $posts;
    $config['title'] = 'TAG ' . $tagName;
    $config['filename'] = $tagName;
    $config['dir'] = ROOT . '/tag';
    $config['document_root'] = '/tag';
    echo "compile paging $tagName ...\n";
    compilePaging($config);
}
